import axios from "axios"

const HomeServer ={

    getHomeData(url,params){
        return new Promise((resolve,reject)=>{
            axios({
                url:url,
                data:params,
            }).then((res)=>{
               resolve(res.data)
            }).catch((error)=>{
                reject(error)
            })
        })
        
    }
}

const DetailServer={
    getGoodsData(url,params){
        return new Promise((resolve,reject)=>{
            axios({
                url:url,
                data:params,
            }).then((res)=>{
               resolve(res.data)
            }).catch((error)=>{
                reject(error)
            })
        })
        
    }
}
const CategoryServer={
    getCategoryData(url,params){
        return new Promise((resolve,reject)=>{
            axios({
                url:url,
                data:params,
            }).then((res)=>{
               resolve(res.data)
            }).catch((error)=>{
                reject(error)
            })
        })
        
    }
}


export {HomeServer,DetailServer,CategoryServer}